import * as Cesium from 'cesium'

export default function initMap(container) {
  const viewer = new Cesium.Viewer(container,
    {
      imageryProvider: new Cesium.TileMapServiceImageryProvider({
        url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
      }),
      creditContainer:document.createElement('span'),
      timeline:false,
      animation : false,
      baseLayerPicker : false,
      fullscreenButton : false,
      geocoder : false,
      homeButton : false,
      navigationHelpButton:false,
      contextOptions:{
        requestWebgl1:true,
      }
    });

  if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
    viewer.resolutionScale = window.devicePixelRatio;
  }
  const {scene} = viewer;
  scene.postProcessStages.fxaa.enabled = true;
  scene.debugShowFramesPerSecond = true;
  return viewer
}